#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int my_strlen1(char* p)
{
	int x = 0;
	while (*p != '\0')
	{
		x++;
		*p++;
	}
	return x;
}

int my_strlen2(char* p)
{
	int x = 0;
	char* str = p;
	char* end = p;
	while (*end)
	{
		end++;
	}
	x = end - str;
	return x;
}

int my_strlen3(char* p)
{
	if (*p != '\0')
	{
		p++;
		return 1 + my_strlen3(p);
	}
	else
	{
		return 0;
	}
}

int main()
{
	char arr[30] = "abcdefg";
	int ret1 = my_strlen1(arr);
	int ret2 = my_strlen2(arr);
	int ret3 = my_strlen3(arr);
	printf("%d\n", ret1);
	printf("%d\n", ret2);
	printf("%d\n", ret3);
	return 0;
}